package com.gs.spring.core.initializing;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;

/**
 * Force the subclass to set up initialization by overriding the initSimple() method... 
 * this is an example of template method pattern
 * @author kalyandasika
 *
 */
public abstract class AbstractSimpleBeanIB implements InitializingBean {

	private String value;

	protected void initSimple() {

	}

	public final void setValue(String value) {
		this.value = value;
	}

	protected final String getValue() {
		return this.value;
	}

	public final void afterPropertiesSet() throws Exception {
		Assert.notNull(value, "The [value] property of ["
				+ getClass().getName() + "] must be set.");
		initSimple();
	}

}
